﻿// <copyright file="ICollection.cs" company="Signal Processing Lab, Wuhan University">
// Copyright (c) 2009-2010 All Right Reserved
// </copyright>
// <author>Xin-ping Deng</author>
// <email>dentoby@gmail.com</email>
// <date>2010-4</date>
// <summary>This is part of Image.NET project.</summary>

namespace SPLWHU.Core
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// The interface of items collection.
    /// </summary>
    /// <typeparam name="T">The type of items in this collection.</typeparam>
    public interface ICollection<T>
    {
        /// <summary>
        /// Gets the count of items in this collection.
        /// </summary>
        /// <value>The count of items.</value>
        int Count { get; }

        /// <summary>
        /// Gets or sets the item at the specified index.
        /// </summary>
        /// <value></value>
        T this[int index] { get; set; }

        /// <summary>
        /// Adds an item to the collection.
        /// </summary>
        /// <param name="item">The item to add.</param>
        void Add(T item);

        /// <summary>
        /// Adds an array of items to the collection.
        /// </summary>
        /// <param name="items">The items to add.</param>
        void Add(params T[] items);

        /// <summary>
        /// Adds a list of items to the collection.
        /// </summary>
        /// <param name="items">The items to add.</param>
        void Add(List<T> items);

        /// <summary>
        /// Adds the items to the collection.
        /// </summary>
        /// <param name="items">The items to add.</param>
        void Add(IEnumerable<T> items);

        /// <summary>
        /// Inserts an item at the specified index.
        /// </summary>
        /// <param name="index">The index to insert.</param>
        /// <param name="item">The item to add.</param>
        void Insert(int index, T item);

        /// <summary>
        /// Removes an item from the collection.
        /// </summary>
        /// <param name="item">The item to remove.</param>
        void Remove(T item);

        /// <summary>
        /// Removes the item at the specified index.
        /// </summary>
        /// <param name="index">The index.</param>
        void RemoveAt(int index);

        /// <summary>
        /// Removes all the items in this instance.
        /// </summary>
        void Clear();

        /// <summary>
        /// Enumerates the items in this instance.
        /// </summary>
        /// <returns>The enumerator to access the items in this collection.</returns>
        IEnumerable<T> Enumerate();

    }
}
